﻿<Row>
    <Column>
        <Card Shadow="Shadow.Default" Margin="Margin.Is3.FromTop">
            <CardBody>
                <Heading Size="HeadingSize.Is5">
                    Latest Posts
                </Heading>
                @foreach ( var item in BlogEntries.Where( x => !x.Pinned ).Take( 2 ) )
                {
                    <Row @key="@item" Margin="Margin.Is3.FromBottom">
                        <Column ColumnSize="ColumnSize.Is5">
                            <Anchor To="@item.Url">
                                <Image Source="@item.Image" Text="Blog post image" Fluid />
                            </Anchor>
                        </Column>
                        <Column ColumnSize="ColumnSize.Is7">
                            <Anchor To="@item.Url" Style="font-size: 1rem;-webkit-box-orient: vertical;display: -webkit-box;overflow: hidden;-webkit-line-clamp: 3;">
                                @item.Text
                            </Anchor>
                        </Column>
                    </Row>
                }
            </CardBody>
        </Card>
    </Column>
</Row>
@code {
    [Parameter] public IEnumerable<BlogEntry> BlogEntries { get; set; }
}
